package com.gzxt.agricultural.controller;

import com.gzxt.agricultural.service.TraceService;
import com.gzxt.agricultural.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/trace")
@CrossOrigin
public class TraceController {
    @Autowired
    private TraceService traceService;

    @RequestMapping("/getTraceInfo")
    public Result getTraceInfo(int traceNumber){

        Result result = traceService.getTraceInfo(traceNumber);
        return result;
    }

    @RequestMapping("/getAllFood")
    public Result getAllFood(){
        Result result = traceService.getAllFood();
        return result;
    }

    @RequestMapping("/getFood")
    public Result getFood(int traceNumber){
        Result result = traceService.getFood(traceNumber);
        return result;
    }
}
